#!/bin/zsh #.zshrc file for zsh(1). export MAIL=/var/spool/mail/$USERNAME export LESS=-cex3M FORTUNE=$(test -x /usr/bin/fortune) export HELPDIR=/usr/lib/zsh/help # directory for run-help function to find export DOOMWADDIR="/home/goku/doom" # For doom! export TIME_STYLE=+" %d-%m-%y %I:%M %P" # Misc colors. NORMAL=" \e[0m" GREEN=" \e[1;32m" YELLOW=" \e[1;33m" WHITE=" \e[1;37m" CYAN=" \e[1;36m" MAILCHECK=300 HISTSIZE=20000 DIRSTACKSIZE=20 eval `dircolors -b` # Use hard limits, except for a smaller stack and no core dumps unlimit limit stack 8192 limit core 0 limit -s umask 022 # Set up aliases alias mv='nocorrect mv' # no spelling correction on mv alias cp='nocorrect cp' # no spelling correction on cp alias mkdir='nocorrect mkdir' # no spelling correction on mkdir alias j=jobs alias pu=pushd alias po=popd alias d='dirs -v' alias h=history alias grep=egrep alias ll='ls -l' alias la='ls -a' alias cls='clear' alias lu='ls -Fula -h' # More useful Aliases. alias tarunpack='tar -zxvf' alias bz2unpack='tar -jxvf' alias mc='mc -a' alias rm='rm -i' alias rm='cp -i' # List only directories and symbolic # links that point to directories alias lsd='ls -ld *(-/DN)' # List only file beginning with "." alias lsa='ls -ld .*' if [ -x /usr/bin/finger ] ; then INFO=$(finger -lmps $LOGNAME | sed -e "s/On/Logged in/g" | grep "since" ) else INFO=$(uname -msov) fi # Shell functions setenv() { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" } # csh compatibility freload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done } # These following functions from http://www.die.net/doc/linux/abs-guide/sample-bashrc.html function my_ip() # get IP adresses. Bracket on next line C style... { MY_IP=$(/sbin/ifconfig ppp0 | awk '/inet/ { print $2 } ' | sed -e s/addr://) MY_ISP=$(/sbin/ifconfig ppp0 | awk '/P-t-P/ { print $3 } ' | sed -e s/P-t-P://) } function lowercase() # move filenames to lowercase. { for file ; do filename=${file##*/} case "$filename" in */*) dirname==${file%/*} ;; *) dirname=.;; esac nf=$(echo $filename | tr A-Z a-z) newname="${dirname}/${nf}" if [ "$nf" != "$filename" ]; then mv "$file" "$newname" echo "lowercase: $file --> $newname" else echo "lowercase: $file not changed." fi done } function badlink() # From Atomic magazine #43 August 2004. http://www.atomicmpc.com.au { DEFAULT=$(tput sgr0); FILELIST=.badlink.list [ -e $FILELIST ] && $( rm -fr $FILELIST ) function checklink() { for badlink in $1/*; do [ -h "$badlink" -a ! -e "$badlink" ] && echo \ \"$badlink\" >> $FILELIST [ -d "$badlink" ] && checklink $badlink done } for directory in `pwd`; do if [ -d $directory ] ; then checklink $directory; fi done if [ -e $FILELIST ] ; then for line in $(cat $FILELIST); do echo $line | xargs -r rm | echo -e "$line \ -removed" echo done rm -fr $FILELIST else printf "Bad symlinks not found.\n\n" fi } # End Atomic function. printf "On this day in the GNU/Linux epoch...\n" /bin/grep "$(date +'%m/%d')" ~/bin/calendar.computer # Where to look for autoloaded function definitions fpath=($fpath ~/.zfunc) READNULLCMD=${PAGER:-/usr/bin/pager} echo -e "${YELLOW}" echo -e "${INFO}" echo -e "$NORMAL" autoload -U compinit compinit autoload -U promptinit; promptinit prompt clint gray25 wheat1